Skip to content

feat: trezor hardware support#792

Open
coreyphillips wants to merge 79 commits into
masterfrom
feat/trezor-hardware-support
Open

feat: trezor hardware support#792
coreyphillips wants to merge 79 commits into
masterfrom
feat/trezor-hardware-support

Conversation

@coreyphillips
Copy link
Copy Markdown

@coreyphillips coreyphillips commented Feb 18, 2026

Description

The Trezor dev dashboard gives native developers a place to test and troubleshoot Trezor hardware flows before user-facing Trezor features ship.

This PR:

  1. Adds USB and Bluetooth Trezor transport support.
  2. Adds the dev-only Trezor dashboard at Settings -> Advanced -> Dev Settings -> Trezor.
  3. Adds optional official Trezor Bridge transport behind TREZOR_BRIDGE=true, so the dashboard can be tested through the official Trezor User Env emulator without a physical device.

Preview

QA Notes

Latest bitkit-core bindings with Trezor hardware support: https://github.com/synonymdev/bitkit-core/releases/tag/v0.1.58

Official emulator setup:

  1. Clone the official Trezor User Env: git clone https://github.com/trezor/trezor-user-env ~/repos/github/trezor-user-env.
  2. Start it from that folder with ./run.sh --no-regtest.
  3. If the Apple Silicon container cannot load SDL3, install the missing runtime packages once with docker exec trezor-user-env.mac sh -lc 'apt-get update && apt-get install -y libsdl3-0 libsdl3-image0'.
  4. Start Bridge and a deterministic T2T1 emulator through the User Env controller:
python3 - <<'PY'
import asyncio, json, websockets

async def send(payload):
    async with websockets.connect('ws://localhost:9001') as ws:
        await ws.recv()
        await ws.send(json.dumps(payload))
        print(await ws.recv())

async def main():
    await send({'type': 'bridge-start', 'version': 'node-bridge', 'id': 1})
    await send({'type': 'emulator-start', 'model': 'T2T1', 'version': '2-main', 'wipe': True, 'id': 2})
    await send({
        'type': 'emulator-setup',
        'mnemonic': 'all all all all all all all all all all all all',
        'pin': '',
        'passphrase_protection': False,
        'label': 'Bitkit Test Trezor',
        'needs_backup': False,
        'id': 3,
    })
    await send({'type': 'background-check', 'id': 4})

asyncio.run(main())
PY

Android emulator install:

  • TREZOR_BRIDGE=true TREZOR_BRIDGE_URL=http://10.0.2.2:21325 ./gradlew installDevDebug

Physical phone install:

  • adb reverse tcp:21325 tcp:21325
  • TREZOR_BRIDGE=true TREZOR_BRIDGE_URL=http://127.0.0.1:21325 ./gradlew installDevDebug

Validation done:

  • Official Trezor User Env cloned at ~/repos/github/trezor-user-env and started with ./run.sh --no-regtest.
  • Host Python websockets installed for controller commands.
  • User Env controller ping passed.
  • bridge-start with node-bridge passed.
  • T2T1 2-main emulator starts after installing libsdl3-0 and libsdl3-image0 in the container.
  • emulator-setup passed with the deterministic all all ... seed and label Bitkit Test Trezor.
  • curl -X POST http://localhost:21325/enumerate returns the official Bridge device: path=1, id=127.0.0.1:21324, apiType=usb.
  • adb reverse tcp:21325 tcp:21325 passed on the Pixel 10 Pro test phone.
  • Bridge-enabled dev APK built and installed on the Pixel 10 Pro from commit 280c4e7.
  • ./gradlew compileDevDebugKotlin testDevDebugUnitTest detekt --rerun-tasks passed.

Manual dashboard tap-through checklist:

  • Scan shows Trezor Bridge Emulator / Bridge device.
  • Connect succeeds and shows Trezor features.
  • Get address succeeds.
  • Get public key succeeds.
  • Sign and verify message succeed.
  • Send/compose path handles the expected no-funds result: xpub lookup returns NATIVE_SEGWIT, 0 sats, 0 UTXOs, and no send form is shown for the unfunded emulator account.
  • Disconnect, reconnect, and forget-device flows clean up state.

- Implement trezor hardware support via USB and Bluetooth
github-advanced-security[bot]

This comment was marked as outdated.

@coreyphillips coreyphillips self-assigned this Feb 18, 2026
@coreyphillips coreyphillips added the enhancement New feature or request label Feb 18, 2026
Comment thread app/src/main/java/to/bitkit/repositories/TrezorRepo.kt Fixed
Comment thread app/src/main/java/to/bitkit/services/TrezorService.kt Fixed
Comment thread app/src/main/java/to/bitkit/ui/screens/trezor/TrezorViewModel.kt Fixed
@coreyphillips coreyphillips marked this pull request as draft March 3, 2026 18:34
Comment thread app/src/main/java/to/bitkit/services/TrezorService.kt Fixed
Comment thread app/src/main/java/to/bitkit/ui/screens/trezor/TrezorScreen.kt Fixed
coreyphillips and others added 3 commits March 5, 2026 12:51
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Bumps bitkit-core version to 0.1.44
- Adds SendTransactionSection.kt
@coreyphillips coreyphillips marked this pull request as ready for review March 7, 2026 18:48
@jvsena42 jvsena42 added this to the 2.2.0 milestone Mar 9, 2026
@jvsena42 jvsena42 self-requested a review March 9, 2026 12:59
jvsena42 added 2 commits March 9, 2026 10:01
# Conflicts:
#	app/src/main/java/to/bitkit/ui/ContentView.kt
#	app/src/main/java/to/bitkit/ui/settings/AdvancedSettingsScreen.kt
#	app/src/main/java/to/bitkit/ui/settings/AdvancedSettingsViewModel.kt
Comment thread app/src/main/java/to/bitkit/ui/settings/AdvancedSettingsScreen.kt Fixed
Comment thread app/src/main/java/to/bitkit/repositories/TrezorRepo.kt Outdated
Comment thread app/src/main/java/to/bitkit/services/TrezorDebugLog.kt Outdated
Comment thread app/src/main/java/to/bitkit/ui/screens/trezor/TrezorViewModel.kt
Comment thread app/src/main/java/to/bitkit/ui/screens/trezor/TrezorViewModel.kt Outdated
Comment thread app/src/main/java/to/bitkit/services/TrezorTransport.kt
Comment thread app/src/main/res/values/strings.xml Outdated
Comment thread app/src/main/java/to/bitkit/ui/screens/trezor/SendTransactionSection.kt Outdated
jvsena42

This comment was marked as resolved.

Comment thread app/src/main/java/to/bitkit/services/TrezorTransport.kt Outdated
Comment thread app/src/main/java/to/bitkit/services/TrezorTransport.kt Outdated
Comment thread app/src/main/java/to/bitkit/repositories/TrezorRepo.kt Outdated
Comment thread app/src/main/java/to/bitkit/repositories/TrezorRepo.kt Outdated
Comment thread app/src/main/java/to/bitkit/ui/screens/trezor/TrezorViewModel.kt
Comment thread app/src/main/java/to/bitkit/repositories/TrezorRepo.kt Outdated
Comment thread app/src/main/java/to/bitkit/services/TrezorTransport.kt Outdated
Comment thread app/src/main/java/to/bitkit/repositories/TrezorRepo.kt Outdated
Comment thread app/src/main/java/to/bitkit/ui/screens/trezor/TrezorViewModel.kt
Comment thread app/src/main/java/to/bitkit/repositories/TrezorRepo.kt Outdated
ovitrif

This comment was marked as outdated.

ovitrif added 2 commits April 2, 2026 22:19
# Conflicts:
#	app/src/main/java/to/bitkit/ui/ContentView.kt
@ovitrif ovitrif modified the milestones: 2.2.0, 2.3.0 Apr 7, 2026
@ovitrif

This comment was marked as outdated.

@coreyphillips

This comment was marked as outdated.

@coreyphillips coreyphillips requested review from jvsena42 and ovitrif May 7, 2026 16:19
@ovitrif

This comment was marked as outdated.

@ovitrif ovitrif self-assigned this May 11, 2026
@ovitrif ovitrif force-pushed the feat/trezor-hardware-support branch from a3fbcf0 to e951e8a Compare May 11, 2026 18:54
@ovitrif ovitrif mentioned this pull request May 11, 2026
7 tasks
@ovitrif ovitrif modified the milestones: 2.3.0, 2.4.0 May 11, 2026
@ovitrif
Copy link
Copy Markdown
Collaborator

ovitrif commented May 11, 2026

Follow-up for review #4033332481: the remaining actionable checklist is handled in stacked PR #939.

No unresolved inline review threads remain on this PR or #939 for this checklist.

@ovitrif ovitrif force-pushed the feat/trezor-hardware-support branch from 42b92f7 to 280c4e7 Compare May 17, 2026 19:36
@ovitrif ovitrif modified the milestones: 2.4.0, 2.3.0 May 17, 2026
Copy link
Copy Markdown
Collaborator

@ovitrif ovitrif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tested multiple times on regtest and added trezor device emulation support in 280c4e7 for automated testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants